package com.dahuyou.javaagent.and.javassist;

import java.lang.instrument.Instrumentation;

/**
 * javaagent入口类
 */
public class MyJavaAgent {

    public static void premain(String agentArgs, Instrumentation instrumentation) {
        // 打印javaagent指定的参数
        System.out.println("agent args is: " + agentArgs);
        // 添加字节码转换器，转换为插桩后的字节码
        MyWasteTimeTransformer myWasteTimeTransformer = new MyWasteTimeTransformer();
        instrumentation.addTransformer(myWasteTimeTransformer);
    }
}
